package org.example.sb_20241005springboot.service;

import org.example.sb_20241005springboot.mapper.MessageMapper;
import org.example.sb_20241005springboot.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:做渐进主义的改良派,不做完没注意的速成派
 * User: XALEXC
 * Date: 2025-02-21
 * Time: 21:34
 */
@Service
public class MessageService {
    @Autowired
    MessageMapper messageMapper;
    public void addMessage(MessageInfo messageInfo) {
        messageMapper.insertMessage(messageInfo);
    }

    public List<MessageInfo> getMessage() {
       return messageMapper.selectAllMessage();
    }
}
